home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / JAVA Utilities / JProxy 1.1.0 / customers / purchases-list.jsp < prev    next >
Encoding:
Text File  |  2003-04-29  |  1.8 KB  |  69 lines

  1. <%@ page language="java" import="
  2.     java.util.*,
  3.     com.jproxy.site.ejbeans.interfaces.*,
  4.     com.jproxy.site.*"
  5.     errorPage="../error-page.jsp"
  6. %>
  7. <jsp:useBean id="ses" scope="session" class="com.jproxy.site.JSPSession"/>
  8. <%
  9. if (!ses.isLoggedIn()) {
  10. %>
  11.   <jsp:forward page="login.jsp">
  12.   </jsp:forward>
  13. <%
  14. }
  15. ses.request(pageContext);
  16. ses.setNewHit(pageContext, "hits", "Customer Purchases List", null);
  17.  
  18. String customerID = ses.getParameter("customer-id");
  19. String productID = ses.getParameter("product-id");
  20. Vector purchases = ses.session.findPurchases(customerID, productID);
  21. System.out.println("FOUND PURCHASES "+purchases.size());
  22.  
  23. %>
  24.   <!-- HEADER -->
  25.   <jsp:include page="header.jsp" flush="true">
  26.     <jsp:param name="pageId" value="purchase_details"/>
  27.   </jsp:include>
  28. <br>
  29. Here you can review your purchase transactions details.
  30. <p>
  31. <table  width=100% border=0>
  32.     <%
  33.     boolean isDark = false;
  34.     for(int i=0; i<purchases.size(); i++)
  35.     {
  36.         String tableBorder = (isDark = !isDark) ? "tableRowDark" : "tableRowLight";
  37.         IPurchase purchase = (IPurchase)purchases.elementAt(i);
  38.     %>
  39.   <tr id=<%=tableBorder%>>
  40.     <td valign="top" width=130>
  41.       amount:<br>
  42.       Number of Licenses:<br>
  43.       Customer Name:<br>
  44.       company:<br>
  45.       email:<br>
  46.       address:<br>
  47.       phone:<br>
  48.       Transaction id:<br>
  49.     </td>
  50.     <td valign="top" width=360>
  51.       <%=purchase.getAmount()%><br>
  52.       <%=purchase.getNumberOfLicenses()%><br>
  53.       <%=purchase.getCustomerName()%><br>
  54.       <%=purchase.getCompany()%><br>
  55.       <%=purchase.getEMail()%><br>
  56.       <%=purchase.getAddress()%><br>
  57.       <%=purchase.getPhone()%><br>
  58.       <%=purchase.getPrimaryKey()%>
  59.     </td>
  60.   </tr>
  61.     <%
  62.     }
  63.     %>
  64. </table>
  65.  
  66.  
  67. <!-- FOOTER -->
  68. <jsp:include page="footer.jsp" flush="true"/>
  69.